<article class="module width_full">
<input type="hidden" value="<?=$this->user['username']?>" />
<header><h3 class="tabs_involved">聊天限制</h3></header>
<div id="kmfile"></div>
<style type="text/css">
select {
    border: 1px solid #bbb;
    height: 25px;
	width: 149px;
	border-radius: 5px;
	box-shadow: inset 0 2px 2px #ccc,0 1px 0 #fff;
}
</style>
<script>
	$(function() {
		$('#gkm').on('click',function() {
			$.ajax({
				url:'/admin778899.php/manage/chat_coin',
				type:'post',
				data:$('#kmform').serialize(),
				dataType:'json',
				success:function(data) {
					if(data.code=0) {
						alert('设置失败');
					}else {
						alert('设置成功');
					}
				},
				error:function() {
					alert('网络出现问题，请检查网络后再次生成卡密');
				}
			});
			return false;
		});
	});
</script>
<?php
$pdo=new PDO($GLOBALS['conf']['db']['dsn'],$GLOBALS['conf']['db']['user'],$GLOBALS['conf']['db']['user']);  
$levelsql = "select * from wwk_chat_user";
$levelinfo = $pdo->query($levelsql)->fetch();
?>
<table>
<tr><td width="360">
	<form action="/admin778899.php/member/chat_coin" id="kmform">
		<table class="tablesorter table2" cellspacing="0" width="100%">
			<tr>
				<td><span class="aq-txt">充值达到多少可以聊天</span></td>
				<td><input name="coin" type="text" class="t-c" value="<?php echo $levelinfo['password'];?>" />元</td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" class="alt_btn" id="gkm" value="设置"/></td>
			</tr>
		</table>
	</form>
	</td>
	
</tr>
</table>
</article>